#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/fpu.h"
#include "driverlib/sysctl.h"
#include "driverlib/rom.h"

#ifndef M_PI
#define M_PI                    3.14159265358979323846
#endif


/// #define SERIES_LENGTH 100 // Original code
#define SERIES_LENGTH 1000 ///// Task #2. Sets the points to 1000

float gSeriesData[SERIES_LENGTH]; /// Defines an array of SERIES_LENGTH size

int32_t i32DataCount = 0; //// Used as iterator

int main(void)
{
    float fRadians;

    ROM_FPULazyStackingEnable(); /// ALlows for interupts
    ROM_FPUEnable(); /////// Turns on the FPU

    ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); /// 50MHz clock

    fRadians = ((2 * M_PI) / SERIES_LENGTH); /////// Full sine wave is 2pi. BUt we want series length discrete chunks

    while(i32DataCount < SERIES_LENGTH) //// Go through each quantized point on wave
    {
	///     	gSeriesData[i32DataCount] = sinf(fRadians * i32DataCount); Original code
    	gSeriesData[i32DataCount] = sinf(fRadians * i32DataCount+90.0f); ///// Task #2. +90.0f to make it into a cosine function.

    	i32DataCount++;
    }

    while(1)
    {
    }
}
